const float B = 3435.0;
const float VCC = 5.0;
const float R1 = 4700.0;
const float R0 = 10000.0;
const float T0 = 298.15;
const float R2 = 4990.0;
const float R3 = 4990.0;

void setup() {
  // put your setup code here, to run once:
	Serial.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly:
	short int adc = analogRead(A0);
	float v = adc * (5.0 / 1023.0);
	float Rth = (R1*(R2+R3))/((VCC*(R2+R3)/v)-R1-R2-R3);
	float ans = 1/((log(ans/R0)+B/T0)/B)-273.15;
	Serial.println("T:");
	Serial.println(ans);
        delay(1000);
}
